using System.Collections;
using System.Collections.Generic;
using UnityEditor.SearchService;
using UnityEngine;
using UnityEngine.SceneManagement;

public class TouchDoorIntoNextEvent : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {

    }
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.tag == "Player")
        {
            if (gameObject.name == "endDoor")
            {
                GameManager.Instance.OpenLoseUI(true);
                return;
            }
            GameManager.Instance.PlayNextGame();
        }
    }
}
